﻿@using System.Web.Mvc
@using System.Web.Mvc.Ajax
@using GestionCompte.Helpers
@using GestionCompte.Models.ManageCategory

@model ManageCategoryModel

@{
    ViewBag.Title = "Gestion des catégories";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>

<h2>Gestion des catégories</h2>

<script type="text/javascript">
    function AjaxCallPage(pageUrl) {
        var frm = $("#partialForm").serialize();
        $.ajax({
            url: pageUrl,
            cache: false,
            async: true,
            type: "Get",
            data: frm, //data to post to server
            error: function (html) { alert(html); }, //something goes wrong...
            success: function (data) {
                $("#containedPage").html(data); //replace our form content
            }
        });
    }
</script>

<div class="container_24 clearfix" style="height:100%">
    <div class="MenuInPage grid4">
        @Html.GenerateMenu("file", FileMenuName:"MenuManageCategory.xml", isAjaxMenu:true, AjaxUrl:Url.Action("partialAdd", "ManageCategory"))
    </div>
    <div id="containedPage" class="PageContent grid20" style="height: 100%;background-color: antiquewhite;">
       @*Content Page*@
        @using (Html.BeginForm("partialAdd", "ManageCategory", FormMethod.Get, new { id = "partialForm"})) { }
    </div>
</div>